using System;
using System.Collections.Generic;

using Servlets.Api;
using Servlets.Exceptions;

namespace Servlets
{
	public class RequestAttributes : IKeyable
	{
		private Dictionary<string, object> map = new Dictionary<string, object>();
		public IEnumerable<string> Keys {
			get {
				return map.Keys;
			}
		}
		public object this [string key] {
			get {
				if(map.ContainsKey(key)) {
					return map[key];
				} else {
					throw new InvalidKeyException(key);
				}
			}
			set {
				map[key] = value;
			}
		}
	}
}

